-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs(cn): translate content/docs/error-boundaries.md into Chinese #153
Conversation
Deploy preview for cn-reactjs ready! Built with commit 0d59fa3 |
Deploy preview for zh-hans-reactjs ready! Built with commit 0d59fa3 |
fix: translate `introducing-error-boundaries` to “错误边界介绍”. Co-Authored-By: LCINA <870206584@qq.com>
fix: merge suggestion. Co-Authored-By: LCINA <870206584@qq.com>
fix: merge suggestion.
Co-Authored-By: LCINA <870206584@qq.com>
好,确实有点奇怪 Co-Authored-By: LCINA <870206584@qq.com>
merge Co-Authored-By: LCINA <870206584@qq.com>
merge Co-Authored-By: LCINA <870206584@qq.com>
merge Co-Authored-By: LCINA <870206584@qq.com>
merge Co-Authored-By: LCINA <870206584@qq.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
类组件统一使用 class 组件,详见词汇表
@LCINA 有空改下? |
ok |
你点错了吧? |
Co-Authored-By: LCINA <870206584@qq.com>
Co-Authored-By: LCINA <870206584@qq.com>
Co-Authored-By: LCINA <870206584@qq.com>
不好意思,已经确认后提交了。 |
@LCINA 我给你发个邮件,你加下群~ |
Co-Authored-By: LCINA <870206584@qq.com>
Co-Authored-By: LCINA <870206584@qq.com>
Co-Authored-By: LCINA <870206584@qq.com>
Co-Authored-By: LCINA <870206584@qq.com>
Co-Authored-By: LCINA <870206584@qq.com>
Co-Authored-By: LCINA <870206584@qq.com>
第 3 行的 titile 也需要翻译的。 |
content/docs/error-boundaries.md
Outdated
A class component becomes an error boundary if it defines either (or both) of the lifecycle methods [`static getDerivedStateFromError()`](/docs/react-component.html#static-getderivedstatefromerror) or [`componentDidCatch()`](/docs/react-component.html#componentdidcatch). Use `static getDerivedStateFromError()` to render a fallback UI after an error has been thrown. Use `componentDidCatch()` to log error information. | ||
如果一个 class 组件中定义了 [`static getDerivedStateFromError()`](/docs/react-component.html#static-getderivedstatefromerror) 或 [`componentDidCatch()`](/docs/react-component.html#componentdidcatch) 这两个生命周期方法中的任意一个(或两个)时,那么它就变成一个错误边界 (error boundary)。当抛出错误后,请使用 `static getDerivedStateFromError()` 渲染备用 UI ,使用 `componentDidCatch()` 打印错误信息。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
前面已经出现了许多次 error boundary ,在这里进行原文注解有些迟了,要注解的话不如挪到正文首次出现的地方?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已做更新。
content/docs/error-boundaries.md
Outdated
|
||
Error boundaries are React components that **catch JavaScript errors anywhere in their child component tree, log those errors, and display a fallback UI** instead of the component tree that crashed. Error boundaries catch errors during rendering, in lifecycle methods, and in constructors of the whole tree below them. | ||
错误边界并不会使整个组件树崩溃,它是 **用于捕获子组件树中任意位置的 JavaScript 错误,记录错误并显示一个备用 UI** 的 React 组件。 错误边界在渲染期间、生命周期方法和整个组件树的构造函数中捕获错误。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
Co-Authored-By: LCINA <870206584@qq.com>
Co-Authored-By: LCINA <870206584@qq.com>
Co-Authored-By: LCINA <870206584@qq.com>
Co-Authored-By: LCINA <870206584@qq.com>
…actjs#153) feat: Complete the translation of the `error-boundaries.md`. reactjs@3ad3ca2
feat: Complete the translation of the
error-boundaries.md
.3ad3ca2